<template>
	<view class="ad-modal">
		<u-mask :show="show">
			<view class="body" @click="close">
				<view class="top">
					<image src="https://xyshop.outletds.com/img/close.png" mode="aspectFit"></image>
				</view>
				<image :src="info.image" mode="aspectFit" @click.stop="openLink"></image>
			</view>
		</u-mask>
	</view>
</template>

<script>
	import dialogSyncClose from '@/mixin/dialog-sync-close.js'
	export default {
		name: "ad-modal",
		mixins: [dialogSyncClose()],
		props: {
			info: {
				type: Object,
				default: {}
			}
		},
		data() {
			return {

			};
		},
		methods: {
			openLink() {
				if (this.info.link.match('tabs')) {
					this.$Router.pushTab(this.info.link)
				} else {
					this.$Router.push(this.info.link)
				}
			},
			close() {
				this.show = false
			}
		}
	}
</script>

<style scoped lang="scss">
	.ad-modal {
		.body {
			width: 100%;
			height: 100%;
			display: flex;
			align-items: center;
			justify-content: center;
			flex-direction: column;

			image {
				width: 517rpx;
				height: 517rpx;
			}
			.top{
				width: 517rpx;
				text-align: right;
				padding: 0 20rpx;
				image{
					width: 50rpx;
					height: 50rpx;
				}
			}
		}
	}
</style>
